UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IV/Su4+Z3O2lyxI/9PwG8vhZNBzQRpiFahLYwKQgGhA='
WHERE
key_id = '38ec8e310fa67feb4cf46842c6a7dbaf43b9d48943b2a0859837bfc3c817e12a'
AND (
token = 'IV/Su4+Z3O2lyxI/9PwG8vhZNBzQRpiFahLYwKQgGhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)