UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+rEB6G7g8tbekVj6IVyLEYR5VIXBk3RzP38ZjgbYqLI='
WHERE
key_id = '3879e37a4ebea9b61adc27a589c32fae80d03f6a8b8ef2871e5803f89ce10512'
AND (
token = '+rEB6G7g8tbekVj6IVyLEYR5VIXBk3RzP38ZjgbYqLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)