UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LTiWI8ST1V/Hz+g72OpNCSxUhIDicNf0XWQ6BvbVLBI='
WHERE
key_id = 'e9951088f20dbae8e4d597e8fca8c6554e9f6d84d7562338aaeb3618879f0ed9'
AND (
token = 'LTiWI8ST1V/Hz+g72OpNCSxUhIDicNf0XWQ6BvbVLBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)