UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sZ/nA7kJul5LKXGqK9zUPkV+fBL12oOGNzB+Pzj5ieU=' 
WHERE 
  key_id = '4ebd4d55f740b97e5bb4a8866ec0ce27b2cb587e5de349cc9f833da5e0ee7428' 
  AND (
    token = 'sZ/nA7kJul5LKXGqK9zUPkV+fBL12oOGNzB+Pzj5ieU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028