UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggfwVs7T/sOhRq3N0LKkelutqxlC19l1uj7UQM6hsr4=' 
WHERE 
  key_id = 'ac29ca6030d3d667a5fc589f9f74fb3a1a314058ea1012e8c9b5e67c9c1a4414' 
  AND (
    token = 'ggfwVs7T/sOhRq3N0LKkelutqxlC19l1uj7UQM6hsr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030