UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jjj+yQv/Mkzs9ex9o0U8ewoQ5jLEEvZenOR4aDVrAgk='
WHERE
key_id = '9d145cd8413f3785a878964a96dc66de28333aaab14476db65839b8effa3ea84'
AND (
token = 'Jjj+yQv/Mkzs9ex9o0U8ewoQ5jLEEvZenOR4aDVrAgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)