UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MSPgA6GeHYKawH66WoJe2W39WwG6/NsA3WMdhr7tRNc=' 
WHERE 
  key_id = 'f61447bded122830d9d734d05c725f02c677499288343bc0523cb1e7a77cb47f' 
  AND (
    token = 'MSPgA6GeHYKawH66WoJe2W39WwG6/NsA3WMdhr7tRNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052