UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/JNN88Ha03omWpzPENaL0Km/hJk+zWk3ZYJFqD8QccA='
WHERE
key_id = 'aa4f2eba8c2c2575eb51cf82d16a911a6cdc26d858867fab7b9c7fd5ab8c218d'
AND (
token = '/JNN88Ha03omWpzPENaL0Km/hJk+zWk3ZYJFqD8QccA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)