UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ikz5QstFUpYHLNHpV6BUXzIS7GEYYE1sM2ljXzo6jPc='
WHERE
key_id = 'f54a0275df93420e0679278dac078673174b03d72be4621ab4be80b9537ef158'
AND (
token = 'ikz5QstFUpYHLNHpV6BUXzIS7GEYYE1sM2ljXzo6jPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)