UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bKR+Q7DKsPN27lt7zSxsQdgy4NVscUdBgaYGyxioBSI='
WHERE
key_id = 'b6c28d2f41e70cdc2b5765d23ca4b5210bfb72fcf255c9844291d7ffd9666b30'
AND (
token = 'bKR+Q7DKsPN27lt7zSxsQdgy4NVscUdBgaYGyxioBSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)