UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2tXOv/1Q2fad0pD68InM3Zms9gAUZIouEPfb3uOqXWs=' 
WHERE 
  key_id = '033314e28889781b759ea7b7a921311ac7b98519c6c3d353bbca72c18d647c5f' 
  AND (
    token = '2tXOv/1Q2fad0pD68InM3Zms9gAUZIouEPfb3uOqXWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038