UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '12pqyvgKIZgbDMLMqDt18QgqMK5YFG8901Azw11c0i0='
WHERE
key_id = '95d4b02353c4d6352ebcd7afacff10c5aaa2234c121e7e065e589f5c111ac6ef'
AND (
token = '12pqyvgKIZgbDMLMqDt18QgqMK5YFG8901Azw11c0i0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)