UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SVuRX3po1iPc75uNIZOXeBf0joT7x7XwZKyjEl/4h/o='
WHERE
key_id = '50eff723580d9f1349fce00bc1b262a6a9611f59b80aaad09e5b5592b8480417'
AND (
token = 'SVuRX3po1iPc75uNIZOXeBf0joT7x7XwZKyjEl/4h/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)