UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xWJYD+wbxAAtT5g6axNEEYU3dJcm73demXxYrqiQ7WM='
WHERE
key_id = '967d8f722acfc7ce051521571b619d93893754e95e6dcf83d467b1d608a28401'
AND (
token = 'xWJYD+wbxAAtT5g6axNEEYU3dJcm73demXxYrqiQ7WM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)