UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+gL/jXpSoRFyzW2s/5YwJRhIsC4vUiqZKUo1d5t+SYk='
WHERE
key_id = '776b5b988cd2069a0291d08b725ed663cc7485fbb782f70f2c12d96609f9a849'
AND (
token = '+gL/jXpSoRFyzW2s/5YwJRhIsC4vUiqZKUo1d5t+SYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)