UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LlFtkRY45I2opWD4Bo5Raa7lYlKMklT5LUAYCmEvKjU='
WHERE
key_id = '1020f71e9ba0f1a51b00881ab97b749cb4f8efdb3fb7c19e543e9492a3e7d2d3'
AND (
token = 'LlFtkRY45I2opWD4Bo5Raa7lYlKMklT5LUAYCmEvKjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)