UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z+R3QUuiOGEL7cMwzA2QPW06rlIX/Qa1LUfKHYQ4Wkc='
WHERE
key_id = 'ac3f81ba4742212dc732f45c2ffb38464dfac9bc6a45e741dc306d2ea329859b'
AND (
token = 'Z+R3QUuiOGEL7cMwzA2QPW06rlIX/Qa1LUfKHYQ4Wkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)