UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd+9tKaHKRauowEq8j9Wn4yi3QJv16q8H/jqdH9pM2hA='
WHERE
key_id = '8e6d0001d0065080bccaf0f829c60839e475bbe63a29d608c6ddeb626cb08a7a'
AND (
token = 'd+9tKaHKRauowEq8j9Wn4yi3QJv16q8H/jqdH9pM2hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)