UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X/2VxI/HMHAtp6Ki+X43MXNMwNVOAWCd8RF/Ty3w3RI=' 
WHERE 
  key_id = 'dd508b82319aa987825a939f95214f3cbaec2e5dc34f5133f4ccc482354d2f44' 
  AND (
    token = 'X/2VxI/HMHAtp6Ki+X43MXNMwNVOAWCd8RF/Ty3w3RI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019