UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F3EmjGcBQ+MG3F7mHljluDSsiaxbSwYdxrJ7Ek8wTe4=' 
WHERE 
  key_id = '42d92fea2e84ea57c46b864039608582f1f7b6cefcd923c6373e0b6ac56eb4a0' 
  AND (
    token = 'F3EmjGcBQ+MG3F7mHljluDSsiaxbSwYdxrJ7Ek8wTe4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040