UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PMWN0x74YIdjF/OJvgE0QJIcYs3Sj77BMJujQw5JVJU=' 
WHERE 
  key_id = 'e8d3278a466dba83a93567ef5888fab15c1fa147cf9b06aeed16e1e54d08d18c' 
  AND (
    token = 'PMWN0x74YIdjF/OJvgE0QJIcYs3Sj77BMJujQw5JVJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017