UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kwzI4ftPL3rrYw4+ZusAu3XMPUvR7Ke9TSuw3ZATQSI='
WHERE
key_id = 'f0150133d452783e38b994d2f0cc9d9cda68a0a56392b31ae8d60b080abd2d09'
AND (
token = 'kwzI4ftPL3rrYw4+ZusAu3XMPUvR7Ke9TSuw3ZATQSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)