UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mBdsOu3VIIO5zjOqQHaTAsAGGbsuHDcwt9oOk6BUn4='
WHERE
key_id = '74b4a9e4051ca39ced3978848c48dcf5092c5685d93f944deee15170e4b7e0bc'
AND (
token = '1mBdsOu3VIIO5zjOqQHaTAsAGGbsuHDcwt9oOk6BUn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)