UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vs2iuGH1SxVIGFgIqUPxWBdZLuzUSJJRNo9lF1gKW+0=' 
WHERE 
  key_id = '6f3fa480425f71fe1e2ba811d08612cd3bf587f4ffaf4dcb1ed4a576284d33d3' 
  AND (
    token = 'Vs2iuGH1SxVIGFgIqUPxWBdZLuzUSJJRNo9lF1gKW+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026