UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xcp28VRaTec9Yfk41POhqbEfItdai6vWBQGhjiMlt6g=' 
WHERE 
  key_id = 'ad9bc1ccb1ecd6ef36fe332f2531d061fdfe676978f8b5f04c9f41be3fe431ec' 
  AND (
    token = 'Xcp28VRaTec9Yfk41POhqbEfItdai6vWBQGhjiMlt6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036