UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '53I9Um7TVPm9gdSALJsyIKkioQVoil31lsOaSM5pchk=' 
WHERE 
  key_id = '40c13232ecf9a93aeaa3361c1ef9254e698bfb4ececeea8288d56391a90177ec' 
  AND (
    token = '53I9Um7TVPm9gdSALJsyIKkioQVoil31lsOaSM5pchk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038