UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1MK4gYlUxf9bcxxvP9V4NUVzbh7zb895H1spLrux1g4=' 
WHERE 
  key_id = '3bc5d3229e56ff8d93c3070cb706f606f0aa48b4034e94a6930be509f8cca67b' 
  AND (
    token = '1MK4gYlUxf9bcxxvP9V4NUVzbh7zb895H1spLrux1g4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032