UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jy3tlv3zxk1mGwrgz7qIXuS9EJ9QZwYAU234sadYBSI='
WHERE
key_id = '2d25296b81ef45054aeda3795fd40f69cd1cffe01c682b97ce2853cfe0100770'
AND (
token = 'Jy3tlv3zxk1mGwrgz7qIXuS9EJ9QZwYAU234sadYBSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)