UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kGVbpgOR8aeFOppiF6cGZBvc7RHyaxd+1gmyh92dv8E='
WHERE
key_id = '440d31349533d10a6ec4d7256e2636f4f482155f319053ed32f90ea93b957423'
AND (
token = 'kGVbpgOR8aeFOppiF6cGZBvc7RHyaxd+1gmyh92dv8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)