UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wUEvhwxi5p/zbU9dGTPvNIyPqOqAa6UzcD1a6CkvCY='
WHERE
key_id = '0c7ba31ae22f1f503df20e07ee7c3afe0ae14e6d361be8a6c110f7f89407ff28'
AND (
token = '7wUEvhwxi5p/zbU9dGTPvNIyPqOqAa6UzcD1a6CkvCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)