UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VKAtInlpq3kq8b0SZQrWN/TYxGufxH291BWuz3fBsD0='
WHERE
key_id = '9e851581a01206a9d31487b8b016e6c60fdf5a2a96e20b23ebed0daf633098af'
AND (
token = 'VKAtInlpq3kq8b0SZQrWN/TYxGufxH291BWuz3fBsD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)