UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2ZOQrgZWUp9PSe25hPCRtk1xe1ANW5U+nwUQH8jNmQ='
WHERE
key_id = 'b57cb29c5bc52b89d7be543e5de15bf25bda93704144b4859e80a75f5629dbba'
AND (
token = 'w2ZOQrgZWUp9PSe25hPCRtk1xe1ANW5U+nwUQH8jNmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)