UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uveztke0UownNfEB0WOJF5KqKyEcSHszQx3eOLjQifk='
WHERE
key_id = '57e70310cc1b2a98decf232e1e527b1a868bda67e86c1babc5183276f1b59c31'
AND (
token = 'uveztke0UownNfEB0WOJF5KqKyEcSHszQx3eOLjQifk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)