UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PleuvrV6TiuDD3qyAF+uWTA6kSSh+nwHTpTjwV6O2k=' 
WHERE 
  key_id = '253885de907ec85b6de2a96fbd22328d73a07c4f31e40227e9d89cf1e2accefa' 
  AND (
    token = '2PleuvrV6TiuDD3qyAF+uWTA6kSSh+nwHTpTjwV6O2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044