UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vFh9/94M86xTvikdkaxZUAe3bKuyk5V+T1j5OW5txKc='
WHERE
key_id = '9aea4be69f953ce003a00ad66587b9620156dcc1824050b59c2d3cf53a8ee86b'
AND (
token = 'vFh9/94M86xTvikdkaxZUAe3bKuyk5V+T1j5OW5txKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)