UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mRlJ9Ag4Fjcbg+X1eiLyCFPmXRhpLQHsyZ4cR7EZ0LQ=' 
WHERE 
  key_id = '59e6f5c2727476c7ffec50e7876735016ca49f935a2c9a94c255f7fc7328bbee' 
  AND (
    token = 'mRlJ9Ag4Fjcbg+X1eiLyCFPmXRhpLQHsyZ4cR7EZ0LQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021