UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'crxryxbE7ZBr7bjDmhtVzk1bVd1sz1qWmDJ/eiL45+E=' 
WHERE 
  key_id = '90597a64691d2a62887a2a90062928b4ce2a6089f51a5229c0031ed77739ae0a' 
  AND (
    token = 'crxryxbE7ZBr7bjDmhtVzk1bVd1sz1qWmDJ/eiL45+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052