UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bPRU8TEyFtY3eYUynxSbv8B6fBLCO6BaKO/lj6EBw9Q=' 
WHERE 
  key_id = 'f9df8e3d2c342587b7179cd85ea0d276536e7578d45c2b6658e2c3596e5d151d' 
  AND (
    token = 'bPRU8TEyFtY3eYUynxSbv8B6fBLCO6BaKO/lj6EBw9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023