UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4tXlA/h1HHCe5zRWEUkUaZjcOb9fqSWehMkZUAX4dg='
WHERE
key_id = 'e43d7df132e8dadbea9adb48cd4fb80edd1cf749de9676b6eed516e3518837e7'
AND (
token = 'F4tXlA/h1HHCe5zRWEUkUaZjcOb9fqSWehMkZUAX4dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)