UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l/qOPLJU1dt138Qz/vHT4grooG5vRJbwoZeUYkEeolA='
WHERE
key_id = '3a1e1f25a687376a1d3e62e49141b1bfc2d67c75e9f92ed1f0623d849de67761'
AND (
token = 'l/qOPLJU1dt138Qz/vHT4grooG5vRJbwoZeUYkEeolA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)