UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FXGQ+qTLmYdU/kHgRuY/Ufxe2v2VDvLy0QroEny6jOE=' 
WHERE 
  key_id = 'baf62e5f83dc6cf504c80668fb2b49298bd314e5126bfc0c53053a45c1b9e348' 
  AND (
    token = 'FXGQ+qTLmYdU/kHgRuY/Ufxe2v2VDvLy0QroEny6jOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035