UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g/5hb2sym90MT73pIv0RlIqxsKxCTGAliZqPprKk2Is=' 
WHERE 
  key_id = '1e7db62c0dee6e99e31bb86e792f4c82066ec278ba1bb8df7d437255c7dd6179' 
  AND (
    token = 'g/5hb2sym90MT73pIv0RlIqxsKxCTGAliZqPprKk2Is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022