UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lIwwh/irLw/nMpX9E/NmaB/8qmY9nWSLDGcPvlFBrac=' 
WHERE 
  key_id = '158d74eff2205606b96ec006ee7b5923e18af65f53c0d71de22c8de6df9e8e0d' 
  AND (
    token = 'lIwwh/irLw/nMpX9E/NmaB/8qmY9nWSLDGcPvlFBrac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030