UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uv34pv2W1/vlCt2r0U0IuoftM0rBII+qFi5QYOkKoAw='
WHERE
key_id = 'be4aaa4d56cdf5dead8bc955cd2275f7699794f225e94158c9c7d749451712c3'
AND (
token = 'uv34pv2W1/vlCt2r0U0IuoftM0rBII+qFi5QYOkKoAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)