UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ee1hDHEMVh82zFwzu/xzoaWtOp52BM4M2ciLi3UmRpQ=' 
WHERE 
  key_id = '1b4f8d6cc50d2aebe077b1201d4326c33faa5e7232a61c21fec5d76d8c70ba0e' 
  AND (
    token = 'Ee1hDHEMVh82zFwzu/xzoaWtOp52BM4M2ciLi3UmRpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016