UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vKBRb1D9Hp5Ra+0ycvkEYnpezCkGC+uUEoZoSe5i76c='
WHERE
key_id = '851d027f94d45610b0ea026c7c1f0568b8bda201a0108dd5436c867ec6c179e0'
AND (
token = 'vKBRb1D9Hp5Ra+0ycvkEYnpezCkGC+uUEoZoSe5i76c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)